const mix = require('laravel-mix');
const path = require('path');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/dist/js');
mix.sass('resources/sass/app.scss', 'public/dist/css');
mix.setPublicPath('public/dist');
mix.setResourceRoot('dist');
mix.webpackConfig({
    output: {
        publicPath: '/dist/',
        filename: '[name].js',
        chunkFilename : '[name].js?id=[chunkhash:20]'
    },
    resolve: {
        alias: {
            '@': path.resolve('resources/js/')
        }
    }
});
mix.version();
// mix.mminify(['public/js/app.js', 'public/css/app.css']);